package com.jnzc.ocr.serv.shop.api.impl;

import com.jnzc.ocr.common.bean.PageResult;
import com.jnzc.ocr.serv.shop.api.ShopCheckApi;
import com.jnzc.ocr.serv.shop.entity.ShopCheck;
import com.jnzc.ocr.serv.shop.filter.ShopCheckFilter;
import com.jnzc.ocr.serv.shop.service.ShopCheckService;
import com.jnzc.ocr.serv.shop.vo.ShopCheckCreateVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * @author zhangcm
 * @version 1.0, 2017-09-29
 */
@RestController
public class ShopCheckApiImpl implements ShopCheckApi {

    @Autowired
    private ShopCheckService shopCheckService;

    @Override
    public ShopCheck find(@RequestParam("id") Long id, @RequestParam("shopId") Long shopId) {
        return shopCheckService.find(id, shopId);
    }

    @Override
    public PageResult<ShopCheck> search(@RequestBody ShopCheckFilter filter, @RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize) {
        return shopCheckService.search(filter, pageNo, pageSize);
    }

    @Override
    public ShopCheck save(@RequestBody ShopCheckCreateVo vo, Long shopId) {
        return shopCheckService.save(vo, shopId);
    }

    @Override
    public Date getLastDate(Long shopId) {
        return shopCheckService.getLastDate(shopId);
    }
}
